package com.hsytech.baoinbao;

import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.LinearLayout;

import com.hsytech.baoinbao.base.BaseActivity;
import com.hsytech.baoinbao.unwaste.WasteUnStorageActivity;
import com.hsytech.baoinbao.waste.WasteStorageActivity;

/**
 * Created by 123 on 2016/3/11.
 */
public class HomeActivity extends BaseActivity {
    private LinearLayout waste_storage_background, waste_un_storage;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_home);
        setCenterTitleText("首页");
        setLeft_button(false);
        setRightBtn(true);
        setRight_button_text("退出");
        waste_storage_background = F(R.id.waste_storage_background);
        waste_storage_background.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                Intent intent = new Intent(HomeActivity.this, WasteStorageActivity.class);
                startActivity(intent);
            }
        });
        waste_un_storage = F(R.id.waste_un_storage);
        waste_un_storage.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                Intent intent = new Intent(HomeActivity.this, WasteUnStorageActivity.class);
                startActivity(intent);
            }
        });
    }

    @Override
    public void onMenuRightBtn() {
        super.onMenuRightBtn();
        SharedPreferencesTools.writeToken(HomeActivity.this, null);
        HomeActivity.this.finish();
    }
}
